-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes for manuscript update. #1
Conversation
… bump version to already match text; re-run notebooks;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional comments:
cluster_tree[cluster_tree['child'] == parent]['parent'], | ||
deaths | ||
) | ||
cpdef np.ndarray simplify_hierarchy(np.ndarray condensed_tree, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The persistence threshold for branches was incorrect. It was easier to write a hierarchy simplification function than to repair epsilon_search
.
return labels, branch_labels | ||
|
||
|
||
def branch_membership_from_centrality(branch_centrality_vectors): | ||
def branch_membership_from_centrality(branch_centrality_vectors, temperature=1.0): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added temperature parameter to control softmax.
return result | ||
|
||
|
||
class BranchCondensedTree(_BaseCondensedTree): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added own versions of the CondensedTree class that colour leaves by their labels.
label_values = np.unique(clusterer.labels_[points]) | ||
noise_points = clusterer.labels_[points] == label_values[-1] | ||
branch_labels[points[noise_points]] = np.argmax(membership[noise_points], axis=1) | ||
labels[points[noise_points]] = label_values[branch_labels[points[noise_points]]] - offset | ||
offset += int(len(label_values) > len(persistences)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only update labels for noise points.
|
||
# Extract unique edges that stay within the cluster | ||
edges = np.unique(edges[edges[:, 0] > -1.0, :], axis=0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes mutual reachability values in the ApproximationGraph
return 1 / depths |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes membership centrality behave as in-cluster centrality.
@@ -85,7 +85,7 @@ def _compute_branch_linkage_of_cluster( | |||
points = space_tree.data.base[cluster_points] | |||
centroid = np.average(points, weights=cluster_probabilities, axis=0) | |||
centralities = metric_fun.pairwise(centroid[None], points)[0, :] | |||
centralities = centralities.max() - centralities | |||
centralities = 1 / centralities |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Simplify algorithm by making in-cluster eccentricity be the distance to centroid.
@@ -1,6 +1,6 @@ | |||
[metadata] | |||
name = pyflasc | |||
version = 0.1.2 | |||
version = 0.1.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Version mentioned in the manuscript.
This PR contains all changes made to the code during a major revision of the Arxiv paper and prepares for version 0.1.3.